package org.rescue.analysis.taxonomy;

/*
 * Implement this interface to add a new sub-taxonomy reader from a taxonomy stored as a 
 * database table. The implementation basically recognizes the specific schema for 
 * the taxonomy table. Given a concepts set (extracted from a subcollection), for each
 * concept in this set, it reads (and stores in conceptToRoot), all the concepts that 
 * lie on the path from the concept to the taxonomy root.
 * Reading conceptToRoot is required to ensure that a sub-taxonomy that covers the given 
 * concepts set is loaded. Consider the following example:
 * concepts set = {A, B, F},
 * Taxonomy = {(A,C), (B,C), (C,D), (E,D), (D,F), (F,G)}
 * 
 *  The covering sub-taxonomy is: {(A,C), (B,C), (C,D), (D,F), (F,G)}. 
 *  One way to ensure this sub-taxonomy is loaded is to read the closure to the 
 *  taxonomy root for each concept. The conceptToRoot list of each concept is:
 *  A = {A,C,D,F,G}
 *  B = {B,C,D,F,G}
 *  F = {F,G}
 *  
 *  This way we include C, D and G in the sub-taxonomy. 
 *  The hash map conceptToNodeMap in SubTaxonomyDB will deal with the repeated occurrence
 *  of concepts in conceptToRoot lists. 
 *        
 */

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

public interface ConceptToRootReader {

	public ResultSet getResultSet (PreparedStatement stmt, Connection conn, int callId);
	
	public ArrayList<String> getNextCtoR(int callId);
	
	public int getRootConcept();
		
}
